import {createApp} from 'vue'
import App from './App.vue'
import router from './router/index'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import globalComponents from '@/components'
import './assets/styles/base.css'
import './css/element.css'
import './assets/font/index.css'
import locale from 'element-plus/es/locale/lang/zh-cn'
import RightBar from './views/component/right-bar.vue';
import {Constant} from "./api/const";
import {Mock} from "./api/mock";
import common from "./utils/common.js"

const app = createApp(App)
// 注册全局的组件 （对所有需要注册的组件进行遍历并注册）
for (const componentItem in globalComponents) {
  app.component(componentItem, globalComponents[componentItem])
}
app.component('RightBar', RightBar);
app.use(router)
app.use(store)
app.use(ElementPlus, { locale })
app.mount('#app')

app.config.globalProperties.$Const = Constant;
app.config.globalProperties.$Mock = Mock;
app.config.globalProperties.$uploadUrl = import.meta.env.VITE_BASE_URL + '/api/common/upload'
app.config.globalProperties.$Common = common;

